<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
<head>    
<meta http-equiv="Content-Type" content="text/html; charset=gbk">
<style>
div.res{display:block;position:fixed;width:800px;height:500px;top:0px;}
</style>
</head>
<body>
<p class="subhead">
o=j result parse
</p>
Pls input request
exp. http://fer1a17.kgb.cm3.tbsite.net/?name=tbuad&keyword=%C5%AE%B0%FC%CD%E2%C3%B3&o=j
<form method="POST" action="jsonshow.php" >
<textarea name="jstr" id="jstr" cols=67 rows=6 ></textarea>
<input name="subtn" id="subtn" type="submit" />
</form>
<p>
<?PHP
include_once 'xml2array.class.php';
include_once 'function.php';
include_once 'function_php_new.php';
function dump($var, $echo=true,$label=null, $strict=true)
{
    $label = ($label===null) ? '' : rtrim($label) . ' ';
    if(!$strict) {
        if (ini_get('html_errors')) {
            $output = print_r($var, true);
            $output = "<pre>".$label.htmlspecialchars($output,ENT_QUOTES)."</pre>";
        } else {
            $output = $label . " : " . print_r($var, true);
        }
    }else {
        ob_start();
        var_dump($var);
        $output = ob_get_clean();
        if(!extension_loaded('xdebug')) {
            $output = preg_replace("/\]\=\>\n(\s+)/m", "] => ", $output);
            $output = '<pre>'. $label. htmlspecialchars($output, ENT_QUOTES). '</pre>';
        }
    }
    if ($echo) {
        echo($output);
        return null;
    }else
        return $output;
}

if(isset($_POST['jstr']) && $_POST['jstr'] != '')
{
    //$ret = getKgbServer2Arr($str);
    $ret = getUrlResArrSupply($_POST['jstr']);
    foreach($ret as &$item){
        if(isset($item['REDKEYS'])){
            unset($item['REDKEYS']);
        }
    }
?>
<div id="res">
<?php
    dump($ret);
}
?>
</div>
</p>
</body>
</html>
